package com.gking.processHarvest.controller;

import com.gking.processHarvest.common.Res;
import com.gking.processHarvest.dto.SetHarvestTagsDto;
import com.gking.processHarvest.service.HarvestTags.HarvestTagsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



@Slf4j
@RestController
@RequestMapping("harvestTags")
public class HarvestTagsController {

    @Autowired
    private HarvestTagsService harvestTagsService;


    /**
     * 为收获设置标签
     *
     * @param setHarvestTagsDto 设置的标签列表 以及收获id
     * @return s
     */
    @PostMapping("/set")
    public Res<String> set(@RequestBody SetHarvestTagsDto setHarvestTagsDto) {
        log.warn("传递过来的收获标签信息为：{}", setHarvestTagsDto);
        return harvestTagsService.set(setHarvestTagsDto.getHarvestId(), setHarvestTagsDto.getList());
    }
}

